package com.efuture.chapterone

/* @Description: Kotlin函数中的默认参数
 * @Auther: zhaoshanshan
 * @Date: 2022/03/04/3:14 下午
 */

fun main() {
    method1("zhaoshanshan",30);
    method2("zhaoshanshan");
    method3("liuyifan",30);
}

private fun method1(name:String,age:Int){
    println("你的姓名是$name,你的年龄是$age");
}
private fun method2(name:String,age:Int=30){//给年龄默认值
    println("你的姓名是$name,你的年龄是$age");
}
private fun method3(name:String="zhaoshanshan",age:Int){//给姓名默认值
    println("你的姓名是$name,你的年龄是$age");
}
    